package test4;

import java.util.Scanner;

public class testCar {
    public static void main(String[] args) {
        test[]  arr = new test[3];
        Scanner  sc = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            test c = new test();
            System.out.println("请输入汽车的品牌");
            String brand = sc.next();
            c.setBrand(brand);
            System.out.println("请输入汽车的价格");
            int price = sc.nextInt();
            c.setPrince(price);
            System.out.println("请输入汽车的颜色");
            String color = sc.next();
            c.setColor(color);

            arr[i] = c ;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i].getPrince());
            System.out.println(arr[i].getBrand());
            System.out.println(arr[i].getColor());
        }
    }
}
